home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 6_functions / match < prev    next >
Text File  |  2001-03-21  |  1KB  |  32 lines

  1. Synopsis:
  2.    $match(<pattern> <word list>)
  3.    $rmatch(<word> <pattern list>)
  4.  
  5. Technical:
  6.    The $match() function searches through a word list and returns the index
  7.    to the word that best matches the given pattern.  Its opposite is the
  8.    $rmatch() function, which tries to match a pattern with a list of words.
  9.    The index counts from 1.
  10.  
  11. Practical:
  12.    These functions are generally most useful for automated processes.  For
  13.    instance, one could try to match a person's address with a predefined
  14.    list of address patterns to see if the client should automatically
  15.    accept channel invitations or DCC CHAT requests.  Because they return
  16.    the index to the best match, and not the matching item, they are mostly
  17.    useful for boolean-type comparisons.
  18.  
  19. Returns:
  20.     0   no matches found
  21.    >0   index to best match in list
  22.  
  23. Examples:
  24.    $match(*oo* blah foo booya)                              returns 2
  25.    $match(*oo* blah fubar erf)                              returns 0
  26.    $rmatch(joebob!jbriggs@drivein.com *.com *jbriggs@*)     returns 2
  27.    $rmatch(joebob!jbriggs@drivein.com *.net *jimbob*)       returns 0
  28.  
  29. See Also:
  30.    filter(6); pattern(6); rfilter(6); rpattern(6)
  31.  
  32.